home *** CD-ROM | disk | FTP | other *** search
/ Mission 3 / Mission 3.zip / Mission 3.iso / tools / facevalu / examples / ex / userwork.lst < prev   
File List  |  1998-04-04  |  70KB  |  1,708 lines

  1. > PROCEDURE open_text_window
  2. LOCAL handle&,index&                           !locals
  3. LET handle&=@textlist_win_open(" System font at 10 points ","",0,3,window_menu&,42,-1,-1,-1,-1,iconify_icon_1&,txt%,txt$())
  4. IF handle&>0                                   !if window opened
  5.   index&=@win_get_index(handle&)               !find index
  6.   num_fonts&=@vdi_load_fonts(window_array&(index&,22))   !load fonts
  7.   ' these are the extended window_array&() entries:
  8.   window_array&(index&,26)=1                   !initial font id
  9.   window_array&(index&,27)=10                  !initial font size
  10.   @textlist_resize(index&,txt%,txt$())
  11. ENDIF
  12. RETURN
  13. > PROCEDURE change_font(index&)
  14. LOCAL id&,size&,wcell&,hcell&,ret%,x&,y&,w&,h&,name$,handle&,fontflags&
  15. IF index&=-1                          !if called by shortcut
  16. ~WIND_GET(0,10,handle&,d&,d&,d&)    !get the top window (the window whose shortcut was used)
  17. index&=@win_get_index(handle&)      !find <index&> for this window
  18. ENDIF
  19. id&=window_array&(index&,26)          !find font id
  20. size&=window_array&(index&,27)        !find font size
  21. '
  22. '   1=include systemfont
  23. '   2=include monospaced
  24. '   4=include proportional
  25. '   8=include bitmap
  26. ' 240=include vector
  27. ' 254=include all
  28. fontflags&=254 !include all
  29. '
  30. ret%=@xfsl(window_array&(index&,22),"Choose font",fontflags&,num_fonts&,name$,id&,size&,wcell&,hcell&)
  31. IF ret%=1                             !if new font/size selected
  32. @win_set_title(index&," "+name$+" "+STR$(size&)+" points ") !set title of window
  33. ' then fill the extended window_array&() entries correctly:
  34. window_array&(index&,26)=id&        !new font id
  35. window_array&(index&,27)=size&       !new font size
  36. ' update the window:
  37. @textlist_resize(index&,txt%,txt$())
  38. @win_send_redraw(index&,-1,-1,-1,-1)   !redraw window
  39. ENDIF
  40. RETURN
  41. '
  42. ' delete the (other) doubled routines:
  43. > PROCEDURE user_rsc_var_init
  44. '
  45. '  You MUST set these variables (and DIMension any listbox arrays here).
  46. '  This is read ONCE, at startup, and the corresponding dialog objects
  47. '  will be set accordingly.
  48. '
  49. current_menubar&=menu&      !set this to the menu bar tree index
  50. ' current_menubar&=window_menu&    !set this to the menu bar tree index
  51. '
  52. ' snap_windows!=TRUE
  53. animate_background_alert!=TRUE
  54. animate_sound_off!=FALSE
  55. '
  56. LET ob_check3_var!=FALSE                  ! TRUE/FALSE - tree: checks&
  57. LET ob_check4_var!=FALSE                  ! TRUE/FALSE - tree: checks&
  58. LET ob_check5_var!=FALSE                  ! TRUE/FALSE - tree: checks&
  59. LET ob_check6_var!=FALSE                  ! TRUE/FALSE - tree: checks&
  60. LET ob_check1_var!=FALSE                  ! TRUE/FALSE - tree: checks&
  61. LET ob_check2_var!=FALSE                  ! TRUE/FALSE - tree: checks&
  62. LET radio1_var&=1                         ! Min=1/Max=2 - tree: radios&
  63. LET a_radio1_var&=1                       ! Min=1/Max=3 - tree: radios&
  64. LET t_pen_trpvar&=1                       ! Min=1/Max=6 - tree: radios&
  65. LET t_pen_var&=1                          ! Min=1/Max=6 - tree: radios&
  66. LET t_spray_var&=1                        ! Min=1/Max=3 - tree: radios&
  67. LET t_line_var&=1                         ! Min=1/Max=8 - tree: radios&
  68. LET t_shape_var&=1                        ! Min=1/Max=16 - tree: radios&
  69. LET t_bezier_var&=1                       ! Min=1/Max=5 - tree: radios&
  70. LET t_circle_var&=1                       ! Min=1/Max=10 - tree: radios&
  71. LET nscroll_var$="-98"                      ! Min=-98/Max=98 - tree: input&
  72. LET nscroll_edit_var$="-98"                 ! Min=-98/Max=98 - tree: input&
  73. LET numeric_var$=""                       ! Max lenght: 6 - tree: input&
  74. LET text_only_var$=""                     ! Max lenght: 8 - tree: input&
  75. LET callback_var$=""                      ! Max lenght: 8 - tree: input&
  76. LET show_callback_var$=""                 ! Max lenght: 8 - tree: input&
  77. LET img_rpop_var&=1                       ! Min=1/Max=48 - tree: popups&
  78. LET txt_rpop_var&=1                       ! Min=1/Max=9 - tree: popups&
  79. LET sa_disppop_var&=1                     ! Min=1/Max=3 - tree: popups&
  80. '
  81. DIM radio_lstbox_arr$(19)                  ! you decide - tree: listbxes&
  82. LET radio_lstbox_ndx&=20                  ! number of entries - tree: listbxes&
  83. LET radio_lstbox_var&=1                   ! the selected option - tree: listbxes&
  84. DIM checl_lstbox_arr$(19)                  ! you decide - tree: listbxes&
  85. DIM checl_lstbox_arr!(19)                  ! you decide - tree: listbxes&
  86. LET checl_lstbox_ndx&=20                   ! number of entries - tree: listbxes&
  87. DIM menu_lstbox_arr$(19)                   ! you decide - tree: listbxes&
  88. LET menu_lstbox_ndx&=20                   ! number of entries - tree: listbxes&
  89. DIM open_listbox1_arr$(19)                 ! you decide - tree: listbxes&
  90. LET open_listbox1_ndx&=20                 ! number of entries - tree: listbxes&
  91. LET open_listbox1_scrl&=0                  ! the initial scroll position
  92. DIM open_lstbox2_arr$(19)                  ! you decide - tree: listbxes&
  93. LET open_lstbox2_ndx&=20                  ! number of entries - tree: listbxes&
  94. LET open_lstbox2_var&=1                   ! the selected option - tree: listbxes&
  95. LET open_lstbox2_scrl&=0                   ! the initial scroll position
  96. DIM open_lstbox3_arr$(19)                  ! you decide - tree: listbxes&
  97. DIM open_lstbox3_arr!(19)                  ! you decide - tree: listbxes&
  98. LET open_lstbox3_ndx&=20                  ! number of entries - tree: listbxes&
  99. LET open_lstbox3_scrl&=0                   ! the initial scroll position
  100. '
  101. b&=65
  102. FOR a&=0 TO 19
  103. radio_lstbox_arr$(a&)=CHR$(b&)+" Radio "+STR$(a&+1)
  104. checl_lstbox_arr$(a&)=CHR$(b&)+" Check "+STR$(a&+1)
  105. menu_lstbox_arr$(a&)=CHR$(b&)+" Menu "+STR$(a&+1)
  106. LET open_listbox1_arr$(a&)="Menu "+STR$(a&+1)
  107. LET open_lstbox2_arr$(a&)="Radio "+STR$(a&+1)
  108. LET open_lstbox3_arr$(a&)="Check "+STR$(a&+1)
  109. INC b&
  110. NEXT a&
  111. '
  112. LET open_lstbox3_ndx&=7                  ! number of entries - tree: listbxes&
  113. LET open_lstbox3_scrl&=0                   ! the initial scroll position
  114. LET mstate1_var&=1                        ! Min=1/Max=3 - tree: mstate&
  115. LET mstate4_var&=1                        ! Min=1/Max=3 - tree: mstate&
  116. LET mstate2_var&=1                        ! Min=1/Max=4 - tree: mstate&
  117. LET mstate3_var&=1                        ! Min=1/Max=6 - tree: mstate&
  118. LET sa_freqpop_var&=1                     ! Min=1/Max=4 - tree: toolstrip&
  119. LET sa_zoompop_var&=1                     ! Min=1/Max=9 - tree: toolstrip&
  120. LET toolbar_radios_var&=1                 ! Min=1/Max=4 - tree: toolbar&
  121. LET prg_modal_var&=1                      ! Min=1/Max=3 - tree: menu&
  122. '
  123. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  124. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  125. '
  126. '    slidemover(index&,object&,display&,min&,max&,chars&,flag!)
  127. @slidemover_set(input&,slider&,slider&,10,0,127,3,TRUE)
  128. ' @fvw_set_slidemover(input&,slider&,slider&,10,0,127,3,TRUE)
  129. '
  130. RETURN
  131. > PROCEDURE user_rsc_interact(index&,tree&,object&,mc&,sub_me&)
  132. '
  133. '  <index&> is the index of this window in window_array&(index&,x)
  134. '           If the object tree is the normal menu bar, <index&>=-1
  135. '   <tree&> is the object tree number
  136. ' <object&> is the object that was selected (clicked on OR shortcut)
  137. '     <mc&> is the number of clicks (1=normal/2=double clicked/1 if shortcut)
  138. ' <sub_me&> is the chosen menuitem in a popup menu
  139. '
  140. SELECT tree&
  141. '
  142. ' ------------------------------------------------------------------------
  143. '
  144. CASE buttons&
  145. SELECT object&
  146. CASE button1&
  147. @messagewin_print("You have pressed 'button1&' (exit)")
  148. CASE button2&
  149. @messagewin_print("You have pressed 'button2' (touchexit)")
  150. CASE close_buttons&
  151. @messagewin_print("Closing the 'Button' dialog")
  152. @win_close(@find_handle_from_tree(tree&))
  153. ENDSELECT
  154. '
  155. ' ------------------------------------------------------------------------
  156. '
  157. CASE checks&
  158. SELECT object&
  159. CASE ob_check1&
  160. @messagewin_print("The value of 'ob_check1_var!' is now "+STR$(ob_check1_var!))
  161. CASE ob_check2&
  162. @messagewin_print("The value of 'ob_check2_var!' is now "+STR$(ob_check2_var!))
  163. CASE ob_check3&
  164. @messagewin_print("The value of 'ob_check3_var!' is now "+STR$(ob_check3_var!))
  165. CASE ob_check4&
  166. @messagewin_print("The value of 'ob_check4_var!' is now "+STR$(ob_check4_var!))
  167. CASE ob_check5&
  168. @messagewin_print("The value of 'ob_check5_var!' is now "+STR$(ob_check5_var!))
  169. CASE ob_check6&
  170. @messagewin_print("The value of 'ob_check6_var!' is now "+STR$(ob_check6_var!))
  171. CASE check_close&
  172. @messagewin_print("Closing the 'Status objects' dialog")
  173. @win_close(@find_handle_from_tree(tree&))
  174. ENDSELECT
  175. '
  176. ' ------------------------------------------------------------------------
  177. '
  178. CASE radios&
  179. SELECT object&
  180. '
  181. '
  182. CASE radios_close&
  183. @messagewin_print("Closing the 'Radio objects' dialog")
  184. @win_close(@find_handle_from_tree(tree&))
  185. CASE t_pen&
  186. @messagewin_print("The value of 't_pen_var&' is now "+STR$(t_pen_var&))
  187. @messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
  188. CASE t_spray&
  189. @messagewin_print("The value of 't_spray_var&' is now "+STR$(t_spray_var&))
  190. @messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
  191. CASE t_line&
  192. @messagewin_print("The value of 't_line_var&' is now "+STR$(t_line_var&))
  193. @messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
  194. CASE t_shape&
  195. @messagewin_print("The value of 't_shape_var&' is now "+STR$(t_shape_var&))
  196. @messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
  197. CASE t_bezier&
  198. @messagewin_print("The value of 't_bezier_var&' is now "+STR$(t_bezier_var&))
  199. @messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
  200. CASE t_circle&
  201. @messagewin_print("The value of 't_circle_var&' is now "+STR$(t_circle_var&))
  202. @messagewin_print("The value of 't_pen_trpvar&' is now "+STR$(t_pen_trpvar&))
  203. CASE radio1&
  204. @messagewin_print("The value of 'radio1_var&' is now "+STR$(radio1_var&))
  205. CASE radio2&
  206. @messagewin_print("The value of 'radio1_var&' is now "+STR$(radio1_var&))
  207. CASE a_radio1&
  208. @messagewin_print("The value of 'a_radio1_var&' is now "+STR$(a_radio1_var&))
  209. CASE a_radio2&
  210. @messagewin_print("The value of 'a_radio1_var&' is now "+STR$(a_radio1_var&))
  211. CASE a_radio3&
  212. @messagewin_print("The value of 'a_radio1_var&' is now "+STR$(a_radio1_var&))
  213. ENDSELECT
  214. '
  215. ' ------------------------------------------------------------------------
  216. '
  217. CASE input&
  218. SELECT object&
  219. CASE nscroll&
  220. @messagewin_print("The value of 'nscroll_var$' is now "+nscroll_var$)
  221. CASE slider&
  222. a&=@slidemover(index&,slider&,slider&,0,127,3,TRUE)
  223. IF sub_me&<>-10
  224. @messagewin_print("The SlideMover reports a value of "+STR$(a&))
  225. ENDIF
  226. CASE nscroll_edit&
  227. @messagewin_print("The value of 'nscroll_edit_var$' is now "+nscroll_edit_var$)
  228. CASE callback&
  229. @rsc_set_text(tree&,show_callback&,callback_var$)
  230. @rsc_ob_draw(index&,show_callback&)
  231. CASE input_close&
  232. @messagewin_print("Closing the 'Input objects' dialog")
  233. @win_close(@find_handle_from_tree(tree&))
  234. CASE text_only&
  235. ENDSELECT
  236. '
  237. ' ------------------------------------------------------------------------
  238. '
  239. CASE popups&
  240. SELECT object&
  241. CASE img_rpop&
  242. @messagewin_print("The value of 'img_rpop_var&' is now "+STR$(img_rpop_var&))
  243. CASE img_mpop&
  244. @messagewin_print("Menu option "+STR$(sub_me&)+" of the 'img_popup' was selected")
  245. CASE txt_rpop&
  246. @messagewin_print("The value of 'txt_rpop_var&' is now "+STR$(txt_rpop_var&))
  247. CASE txt_mpop&
  248. @messagewin_print("Menu option "+STR$(sub_me&)+" of the 'txt_mpop' was selected")
  249. CASE sa_disppop&
  250. @messagewin_print("The value of 'sa_disppop_var&' is now "+STR$(sa_disppop_var&))
  251. CASE popup_close&
  252. @messagewin_print("Closing the 'Popups' dialog")
  253. @win_close(@find_handle_from_tree(tree&))
  254. ENDSELECT
  255. '
  256. ' ------------------------------------------------------------------------
  257. '
  258. CASE listbxes&
  259. SELECT object&
  260. CASE radio_lstbox&
  261. LET radio_lstbox_var&=@listbox_radio(index&,object&,radio_lstbox_var&,radio_lstbox_ndx&,radio_lstbox_arr$())
  262. @messagewin_print("The value of 'radio_lstbox_var&' is now "+STR$(radio_lstbox_var&))
  263. CASE checl_lstbox&
  264. @listbox_list(index&,object&,checl_lstbox_ndx&,checl_lstbox_arr$(),checl_lstbox_arr!())
  265. @messagewin_print("The content of the 'checl_lstbox_arr!()' array may have changed")
  266. CASE menu_lstbox&
  267. a&=@listbox_menu(index&,object&,menu_lstbox_ndx&,menu_lstbox_arr$())
  268. @messagewin_print("Menu option "+STR$(a&)+" of the 'menu_lstbox' was selected")
  269. CASE open_listbox1&
  270. a&=@open_listbox_menu(index&,sub_me&,object&,open_listbox1_ndx&,open_listbox1_arr$(),open_listbox1_scrl&)
  271. @messagewin_print("Menu option "+STR$(a&)+" of the 'open_listbox1' was selected")
  272. SELECT a&
  273. CASE 0
  274. CASE 1
  275. CASE 2
  276. CASE 3
  277. ENDSELECT
  278. CASE open_lstbox2&
  279. LET open_lstbox2_var&=@open_listbox_radio(index&,sub_me&,object&,open_lstbox2_var&,open_lstbox2_ndx&,open_lstbox2_arr$(),open_lstbox2_scrl&)
  280. @messagewin_print("The value of 'open_lstbox2_var&' is now "+STR$(open_lstbox2_var&))
  281. CASE open_lstbox3&
  282. @open_listbox_list(index&,sub_me&,object&,open_lstbox3_ndx&,open_lstbox3_arr$(),open_lstbox3_arr!(),open_lstbox3_scrl&)
  283. @messagewin_print("The content of the 'open_lstbox3_arr!()' array may have changed")
  284. CASE lstbox_close&
  285. @messagewin_print("Closing the 'Listbox objects' dialog")
  286. @win_close(@find_handle_from_tree(tree&))
  287. ENDSELECT
  288. '
  289. ' ------------------------------------------------------------------------
  290. '
  291. CASE mstate&
  292. SELECT object&
  293. CASE mstate1&
  294. @messagewin_print("The value of 'mstate1_var&' is now "+STR$(mstate1_var&))
  295. CASE mstate4&
  296. @messagewin_print("The value of 'mstate4_var&' is now "+STR$(mstate4_var&))
  297. CASE mstate2&
  298. @messagewin_print("The value of 'mstate2_var&' is now "+STR$(mstate2_var&))
  299. CASE mstate3&
  300. @messagewin_print("The value of 'mstate3_var&' is now "+STR$(mstate3_var&))
  301. CASE mstate_close&
  302. @messagewin_print("Closing the 'Multistate objects' dialog")
  303. @win_close(@find_handle_from_tree(tree&))
  304. ENDSELECT
  305. '
  306. ' ------------------------------------------------------------------------
  307. '
  308. CASE other&
  309. SELECT object&
  310. CASE misc_drag&
  311. @messagewin_print("The object 'misc_move&' was dropped on a window. Handle: "+STR$(sub_me&))
  312. CASE misc_move&
  313. IF mc&=2
  314. @messagewin_print("The object 'misc_move&' was doubleclicked")
  315. ENDIF
  316. CASE misc_close&
  317. @messagewin_print("Closing the 'Other objects' dialog")
  318. @win_close(@find_handle_from_tree(tree&))
  319. ENDSELECT
  320. '
  321. ' ------------------------------------------------------------------------
  322. '
  323. CASE resize_me&
  324. SELECT object&
  325. CASE resize_close&
  326. @messagewin_print("Closing the 'Resizeable' dialog")
  327. @win_close(@find_handle_from_tree(tree&))
  328. DEFAULT
  329. @messagewin_print("The 'Resizeable' dialog was resized")
  330. ENDSELECT
  331. '
  332. ' ------------------------------------------------------------------------
  333. '
  334. CASE foldable&
  335. SELECT object&
  336. CASE foldable_close&
  337. @messagewin_print("Closing the 'Foldable' dialog")
  338. @win_close(@find_handle_from_tree(tree&))
  339. ENDSELECT
  340. '
  341. ' ------------------------------------------------------------------------
  342. '
  343. CASE toolstrip&
  344. SELECT object&
  345. CASE sa_freqpop&
  346. CASE sa_zoompop&
  347. CASE toolstrip_open&
  348. CASE sa_play_dma&
  349. CASE toolstrip_save&
  350. ENDSELECT
  351. '
  352. ' ------------------------------------------------------------------------
  353. '
  354. CASE menu&
  355. SELECT object&
  356. CASE about&
  357. ~@alert_wind(1,fv_copyright&,"")
  358. CASE demo_quit&
  359. exit_program!=TRUE
  360. CASE m_buttons&
  361. ~@win_open_dialog(prg_modal_var&,buttons&,iconify_icon_1&)
  362. CASE m_status&
  363. ~@win_open_dialog(prg_modal_var&,checks&,iconify_icon_1&)
  364. CASE m_radios&
  365. ~@win_open_dialog(prg_modal_var&,radios&,iconify_icon_1&)
  366. CASE m_input&
  367. ~@win_open_dialog(prg_modal_var&,input&,iconify_icon_1&)
  368. CASE m_popups&
  369. ~@win_open_dialog(prg_modal_var&,popups&,iconify_icon_1&)
  370. CASE m_listboxes&
  371. ~@win_open_dialog(prg_modal_var&,listbxes&,iconify_icon_1&)
  372. CASE m_multistate&
  373. ~@win_open_dialog(prg_modal_var&,mstate&,iconify_icon_1&)
  374. CASE m_resize&
  375. ~@win_open_dialog(prg_modal_var&,resize_me&,iconify_icon_1&)
  376. CASE m_foldable&
  377. ~@win_open_dialog(prg_modal_var&,foldable&,iconify_icon_1&)
  378. CASE m_other&
  379. ~@win_open_dialog(prg_modal_var&,other&,iconify_icon_1&)
  380. CASE menu_ascii&
  381. ~@win_open_dialog(4,fvt_asci&,-1)
  382. CASE menu_alerts&
  383. IF @alert_wind(1,alert_1&,"")=1
  384. ~@alert_wind(1,alert_3&,"")=1
  385. ENDIF
  386. CASE menu_progress&
  387. @progress_open("New: Title!",-1)                !user added
  388. FOR albert&=0 TO 4000                           !user added
  389. EXIT IF @progress_update(INT(albert&/40))     !user added
  390. NEXT albert&                                    !user added
  391. @progress_close                                 !user added
  392. CASE menu_busy&
  393. time&=@busy_open(TRUE)                          !user added
  394. FOR a&=0 TO 4000                                !user added
  395. EXIT IF @busy_update(time&)                   !user added
  396. NEXT a&                                         !user added
  397. @busy_close                                     !user added
  398. CASE demo_simple_win&
  399. ~@win_open(" Standard window ","  Info line...",simple_window%,backgrnd&,800,800,16,16,12,0,0,800,800,iconify_icon_1&)
  400. CASE demo_hor_tlstrip&
  401. ~@win_open(" Toolstrip window ","",toolstrip_window%,toolstrip&,800,800,16,16,12,0,0,800,800,iconify_icon_1&)
  402. CASE demo_ver_toolbar&
  403. ~@win_open(" Toolbar window ","",toolbar_window%,toolbar&,800,800,16,16,12,0,0,800,800,iconify_icon_1&)
  404. CASE demo_menu_window&
  405. @open_text_window
  406. CASE iconify_all&
  407. @win_iconify_all
  408. CASE uniconify_all&
  409. @win_uniconify_all
  410. CASE menu_help&
  411. ' @call_st_guide("EXAMPLE.HYP","Menu")       !*****calls menu help page
  412. @call_st_guide("EXAMPLE.HYP","")            !*****calls main (content) page
  413. CASE menu_gen_help&
  414. ' @call_st_guide("EXAMPLE.HYP","Menu")       !*****calls menu help page
  415. @call_st_guide("EXAMPLE.HYP","")            !*****calls main (content) page
  416. CASE prg_modal&
  417. CASE non_modal&
  418. CASE toolbox_modal&
  419. ENDSELECT
  420. '
  421. ' ------------------------------------------------------------------------
  422. '
  423. CASE window_menu&
  424. SELECT object&
  425. CASE font_selector&
  426. @change_font(index&)
  427. CASE test&
  428. ENDSELECT
  429. '
  430. ' ------------------------------------------------------------------------
  431. '
  432. CASE fvt_altr&
  433. alert_result&=SUB(object&,7)
  434. @win_close(@find_handle_from_tree(fvt_altr&))
  435. '
  436. ' ------------------------------------------------------------------------
  437. '
  438. '
  439. CASE tear_off&
  440. '
  441. @popup_win_do(index&,tree&,object&,mc&,sub_me&)
  442. '
  443. ' ------------------------------------------------------------------------
  444. '
  445. CASE t_pens&
  446. '
  447. @popup_win_do(index&,tree&,object&,mc&,sub_me&)
  448. '
  449. ' ------------------------------------------------------------------------
  450. '
  451. CASE t_sprays&
  452. '
  453. @popup_win_do(index&,tree&,object&,mc&,sub_me&)
  454. '
  455. ' ------------------------------------------------------------------------
  456. '
  457. CASE t_lines&
  458. '
  459. @popup_win_do(index&,tree&,object&,mc&,sub_me&)
  460. '
  461. ' ------------------------------------------------------------------------
  462. '
  463. CASE t_shapes&
  464. '
  465. @popup_win_do(index&,tree&,object&,mc&,sub_me&)
  466. '
  467. ' ------------------------------------------------------------------------
  468. '
  469. CASE t_beziers&
  470. '
  471. @popup_win_do(index&,tree&,object&,mc&,sub_me&)
  472. '
  473. ' ------------------------------------------------------------------------
  474. '
  475. CASE t_rshapes&
  476. '
  477. @popup_win_do(index&,tree&,object&,mc&,sub_me&)
  478. '
  479. ' ------------------------------------------------------------------------
  480. '
  481. '
  482. ' ⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧ FV-Update ⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧⇧
  483. '
  484. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  485. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  486. '
  487. ENDSELECT
  488. RETURN
  489. > PROCEDURE user_on_open
  490. '
  491. ' This procedure is called when the program is run, after the RSC is
  492. ' loaded and just before the main loop. You can open program windows,
  493. ' toolboxes etc. here, or  init things for your program like
  494. ' loading an *.INF or .DAT file.
  495. '
  496. ' If run as an accessory, this procedure is called EVERY TIME
  497. ' THE ACCESSORY IS OPENED. If you need to do anything just ONCE,
  498. ' like disable menu-entries spesific to PROGRAM execution, set a global
  499. ' flag here to avoid doing things EVERY time the accessory is opened.
  500. '
  501. LOCAL num_lines&,file$
  502. '
  503. IF dimmed!=FALSE   !to avoid reloading when run as acc...
  504. num_lines&=250
  505. DIM txt$(num_lines&),txt!(num_lines&)
  506. dimmed!=TRUE
  507. LET file$="EX.TXT"+CHR$(0)
  508. LET fh&=GEMDOS(61,L:V:file$,0)
  509. IF fh&=>0
  510. LET txt%=MAX(1,@fread_to_array(fh&,-1,txt$()))
  511. ELSE
  512. LET txt%=0
  513. ENDIF
  514. WHILE txt%>0
  515. EXIT IF TRIM$(txt$(PRED(txt%)))<>""
  516. DEC txt%
  517. WEND
  518. ENDIF
  519. '
  520. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  521. @messagewin_open(" Messagewindow ",50,200,20,400,180,iconify_icon_1&)   !ΩΩFVW:messagewinΩΩ
  522. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  523. '
  524. RETURN
  525. > PROCEDURE user_win_close_all
  526. '
  527. ' This procedure is called when the WIN_CLOSE_ALL procedure of the FV engine
  528. ' is called, and before the windows are closed and the window arrays erased.
  529. '
  530. ' If you have any resources attatched to each window, you can clean them
  531. ' up here. (releasing memory etc.)
  532. '
  533. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  534. @messagewin_close                                                       !ΩΩFVW:messagewinΩΩ
  535. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  536. '
  537. LOCAL a&                                           !locals
  538. FOR a&=0 TO max_number_windows&                    !check all windows
  539. IF window_array&(a&,0)>0                         !if the handle is valid
  540. IF window_array&(a&,1)=0                       !if a user window
  541. IF window_array&(a&,8)=42                    !if userhandle=42 (set when opened)
  542. @vdi_unload_fonts(window_array&(a&,22))    !unload fonts
  543. ENDIF
  544. ENDIF
  545. ENDIF
  546. NEXT a&
  547. '
  548. RETURN
  549. > PROCEDURE user_window_content(index&,userhandle&,off_x%,off_y%,cx&,cy&,cw&,ch&)
  550. ~GRAF_MOUSE(256,0) !hidem - to avoid "mousedroppings"
  551. '
  552. ' This procedure is called when a user window needs to be redrawn.
  553. ' ALL of the window content should be drawn here. The x & y offsets
  554. ' will be automatically updated by the system and are ALWAYS current.
  555. ' DO NOT alter the clipping rectangle, it is set (walking the
  556. ' rectangle list) BEFORE calling this procedure.
  557. '
  558. ' All your coordinates should be relative to the upper left of
  559. ' the work area of the window, except for blitting wich is relative
  560. ' to the upper left of the screen. If the window is scrollable/has sliders,
  561. ' subtract <off_x&> from ALL x-coordinates and <off_y&> from ALL
  562. ' y-coordinates.
  563. '
  564. ' <index&> is the index of this window in window_array&(index&,x)
  565. ' <userhandle&> is the userhandle you gave when opening the window
  566. ' <off_x&> is the x offset of the window contents
  567. ' <off_y&> is the y offset of the window contents
  568. ' <cx&>,<cy&>,<cw&>,<ch&> is the clipping rectangle set
  569. '
  570. ' window_array&(index&,22)=vdi handle for this window or <=0 if none
  571. '
  572. LOCAL a&
  573. SELECT userhandle&
  574. CASE 12
  575. FOR a&=95 TO 395 STEP 100
  576. CIRCLE 400-off_x%,400-off_y%,a&
  577. NEXT a&
  578. ENDSELECT
  579. '
  580. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  581. ' The following wrinkle-code is new, since you have updated:
  582. IF userhandle&=viewer_userhandle_&                      !ΩΩFVW:fileviewerΩΩ
  583. @textlist_draw(index&,off_x%,off_y%,cx&,cy&,cw&,ch&,viewer_entries_%,viewer_$(),viewer_selected_!())    !ΩΩFVW:fileviewerΩΩ
  584. ENDIF                                                   !ΩΩFVW:fileviewerΩΩ
  585. IF userhandle&=messagewin_userhandle_&                                  !ΩΩFVW:messagewinΩΩ
  586. @textlist_draw(index&,off_x%,off_y%,cx&,cy&,cw&,ch&,messagewin_entries_%,messagewin_$(),messagewin_selected_!())      !ΩΩFVW:messagewinΩΩ
  587. ENDIF                                                                   !ΩΩFVW:messagewinΩΩ
  588. ' ---------------------------------------------------------------------------   !ΩΩFVW:textlistΩΩ
  589. ' Textlist-Wrinkle:     (©1997 by Holger Herzog)                                !ΩΩFVW:textlistΩΩ
  590. '                                                                               !ΩΩFVW:textlistΩΩ
  591. ' Draw your textlists here. Just call textlist_draw like it is described in     !ΩΩFVW:textlistΩΩ
  592. ' wrinkle_info.                                                                 !ΩΩFVW:textlistΩΩ
  593. '                                                                               !ΩΩFVW:textlistΩΩ
  594. SELECT userhandle&                                                            !ΩΩFVW:textlistΩΩ
  595. CASE 42
  596. @textlist_draw(index&,off_x%,off_y%,cx&,cy&,cw&,ch&,txt%,txt$(),txt!())
  597. ENDSELECT                                                                     !ΩΩFVW:textlistΩΩ
  598. '
  599. ~GRAF_MOUSE(257,0) !showm - display pointer again
  600. RETURN
  601. > PROCEDURE user_keyb(handle&,userhandle&,index&,ks&,key&)
  602. '
  603. '
  604. ' To help you get going:
  605. '
  606. ' scancode         : BYTE(SHR(key&,8))
  607. ' ascii value      : BYTE(key&)
  608. ' IF AND(ks&,&X11) : shift key pressed (either one)
  609. ' IF BTST(ks&,2)   : control key pressed
  610. ' IF BTST(ks&,3)   : alternate key pressed
  611. '
  612. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  613. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  614. '
  615. RETURN
  616. > FUNCTION user_win_close_ok(index&,userhandle&)
  617. $F%
  618. '
  619. ' User wants to close the userwindow in <index&>
  620. ' <userhandle&> is the userhandle you gave when opening the window
  621. ' Return value: TRUE  to close window
  622. '               FALSE to ignore close call
  623. '
  624. ' The code in this function is just an example. If you want to use an
  625. ' alert, you may (should?:-) want to use a windowed alert...
  626. '
  627. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  628. ' The following wrinkle-code is new, since you have updated:
  629. IF userhandle&=viewer_userhandle_&                                      !ΩΩFVW:fileviewerΩΩ
  630. @viewer_close                                                           !ΩΩFVW:fileviewerΩΩ
  631. RETURN TRUE                                                             !ΩΩFVW:fileviewerΩΩ
  632. ENDIF                                                                   !ΩΩFVW:fileviewerΩΩ
  633. IF userhandle&=messagewin_userhandle_&                          !ΩΩFVW:messagewinΩΩ
  634. @messagewin_close                                             !ΩΩFVW:messagewinΩΩ
  635. RETURN TRUE                                                   !ΩΩFVW:messagewinΩΩ
  636. ENDIF                                                           !ΩΩFVW:messagewinΩΩ
  637. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  638. '
  639. IF userhandle&=42             !if textwindow (userhandle set when opened)
  640. @vdi_unload_fonts(window_array&(index&,22))    !unload fonts
  641. ENDIF
  642. '
  643. ' SELECT FORM_ALERT(1,"[1][Really close? ][ OK |Cancel]")
  644. ' CASE 1
  645. RETURN TRUE
  646. ' CASE 2
  647. '   RETURN FALSE
  648. ' ENDSELECT
  649. '
  650. ENDFUNC
  651. > PROCEDURE user_textlist_dragdrop(source&,dest&,dx&,dy&)
  652. '
  653. ' written on 25.09.1996 by Holger Herzog
  654. '
  655. ' Version 1.1
  656. '
  657. ' This procedure is called if the user has moved one or a few entries
  658. ' of a textlist-window by drag and drop. Be advised that source- and
  659. ' destinationwindow could be same.
  660. '
  661. '     source&                 ==> FV-Index of source-window
  662. '     dest&                   ==> FV-Index of destination-window
  663. '     dx&, dy&                ==> position (in pixels) where the user has
  664. '                                 dopped the entries (realtive to the left
  665. '                                 upper corner of the destination-window)
  666. '
  667. ' Version 1.0         27.09.1996 Holger Herzog
  668. ' Version 1.1         29.03.1997 Holger Herzog
  669. '                     Docu now in english :-)
  670. '
  671. ' LOCAL source_handle&,source_userhandle&
  672. ' LOCAL dest_handle&,dest_userhandle&
  673. ' LOCAL off_x&,off_y&
  674. '
  675. ' LET source_handle&=window_array&(source&,0)
  676. ' LET source_userhandle&=window_array&(source&,8)
  677. ' LET dest_handle&=window_array&(dest&,0)
  678. ' LET dest_userhandle&=window_array&(dest&,8)
  679. ' LET off_x&=window_array&(dest&,10)
  680. ' LET off_y&=window_array&(dest&,11)
  681. '
  682. '
  683. RETURN
  684. > PROCEDURE user_rsc_context_help(tree&)
  685. SELECT tree&
  686. CASE buttons&
  687. @call_st_guide("EXAMPLE.HYP","Button objects")
  688. CASE checks&
  689. @call_st_guide("EXAMPLE.HYP","Status objects")
  690. CASE radios&
  691. @call_st_guide("EXAMPLE.HYP","Radio objects")
  692. CASE input&
  693. @call_st_guide("EXAMPLE.HYP","Input objects")
  694. CASE popups&
  695. @call_st_guide("EXAMPLE.HYP","Pop Ups")
  696. CASE listbxes&
  697. @call_st_guide("EXAMPLE.HYP","Listboxes")
  698. CASE mstate&
  699. @call_st_guide("EXAMPLE.HYP","Multiple state")
  700. CASE other&
  701. @call_st_guide("EXAMPLE.HYP","Misc. objects")
  702. CASE resize_me&
  703. @call_st_guide("EXAMPLE.HYP","Sizeable dialog")
  704. CASE foldable&
  705. @call_st_guide("EXAMPLE.HYP","Foldable")
  706. CASE toolstrip&
  707. @call_st_guide("EXAMPLE.HYP","Toolstrip")
  708. CASE toolbar&
  709. @call_st_guide("EXAMPLE.HYP","Toolbar")
  710. CASE menu&
  711. @call_st_guide("EXAMPLE.HYP","Menu")
  712. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  713. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  714. DEFAULT
  715. @call_st_guide("EXAMPLE.HYP","")
  716. ENDSELECT
  717. RETURN
  718. > PROCEDURE user_var_index
  719. ' ap_id&                    : application id
  720. ' menu_id&                  : id for menu_register()
  721. ' acc!                      : running as an accessory
  722. ' exit_program!             : quits program when set to TRUE
  723. ' commandline$              : the commandline the prg was started with (empty if acc)
  724. ' forced_exit!              : system shutdown flag
  725. ' menubar_adress%           : rsc adress of current menu bar
  726. ' current_menubar&          : tree number of current menu bar
  727. ' current_menutitle&        : menu title in @menu_selected,-1 if not in @menu_selected
  728. ' compiled!                 : GFA: compiled
  729. ' multitasking!             : multitasking OS
  730. ' program_path$             : the path the program was launched from
  731. ' rsc_path_name$            : path & name of RSC-file (".\DATA\EX.RSC")
  732. ' max_number_windows&       : maximum number of allowed windows
  733. ' window_array_size&        : size of window_array&() elements per window
  734. ' windowtree_array_size&    : size of window_tree%() elements per window
  735. ' iconify_method&           : 0=disabled/1=internal/2=ICFS/3=MultiTOS
  736. ' ARRAY window_array&(x,y)  : array for window/dialog info
  737. ' ARRAY window_tree%(x,y)   : array for tree adresses/title/infoadress of windows
  738. ' ARRAY iconify!()          : handles for iconification without ICFS
  739. ' progress_handle&          : handle of progress indicator/0 if no indicator
  740. ' menu_disabled!            : menu titles disabled for modal dialogs
  741. ' no_w_topping!             : no window topping allowed while modal dialog
  742. ' top_modal&                : the index of the top modal dialog, -1 if none
  743. ' fv_aes_lock_num&          : used as a safeguard for the aes_(un)lock_screen routines
  744. ' ARRAY message&()          : used in redrawing windows/calling ST-Guide
  745. ' num_prgdef_objects&       : number of prgdef objects in RSC
  746. ' flydials_handle&          : virtual workstation handle for GFA Flydials
  747. ' last_tree&                : last object tree in RSC
  748. ' system_pool%              : adress of system memory malloced for the interface
  749. ' prgdef_adress%            : prgdef object memory adress
  750. ' st_guide%                 : memory adress of 256 byte block for interfacing with ST-Guide
  751. ' alert_result&             : button clicked in alert
  752. ' return_value&             : the return value of the program
  753. ' gem_through&              : flag for letting *all* GEM messages through to @user_gem_messages() if >0
  754. ' fv_malloced%              : variable used to keep track of memory allocation
  755. ' fv_malloced2%             : variable used to keep track of memory allocation
  756. ' animate_background_alert! : allow backround window alert icon animation if set
  757. ' animate_sound_off!        : turn animated animations` sound off
  758. ' animation_timer%          : for kernel use if busy dialog is used
  759. ' no_rsc_found$             : alert string if the RSC connot be found
  760. ' not_accessory$            : alert string if run as acc not allowed
  761. ' systemcheck_alert$        : alert string it systemcheck is not ok
  762. ' snap_windows!             : snap edge of window to word boundary (horisontal)
  763. ' gdos_minimum&             : GDOS program requirement as set in FrontEnd
  764. ' fv_aes_timer&             : used for evnt_multi to make timer events possible
  765. ' ARRAY fvrc_evnt&()        : used for evnt_multi to make rectangle events possible
  766. '
  767. ' ---------------------------------------------------------------------------
  768. ' OBJECT TREE NAMES:
  769. ' system&                             :dialog
  770. ' arrow&                              :dialog
  771. ' animcheck2&                         :dialog
  772. ' smiley&                             :dialog
  773. ' state_3&                            :dialog
  774. ' state_4&                            :dialog
  775. ' state_6&                            :dialog
  776. ' switch&                             :dialog
  777. ' animbut&                            :dialog
  778. ' tear_off&                           :dialog
  779. ' pause&                              :dialog
  780. ' t_pens&                             :dialog
  781. ' t_sprays&                           :dialog
  782. ' t_lines&                            :dialog
  783. ' t_shapes&                           :dialog
  784. ' t_beziers&                          :dialog
  785. ' t_rshapes&                          :dialog
  786. ' horisontal&                         :dialog
  787. ' buttons&                            :dialog
  788. ' checks&                             :dialog
  789. ' radios&                             :dialog
  790. ' input&                              :dialog
  791. ' popups&                             :dialog
  792. ' listbxes&                           :dialog
  793. ' mstate&                             :dialog
  794. ' other&                              :dialog
  795. ' resize_me&                          :dialog
  796. ' foldable&                           :dialog
  797. ' toolstrip&                          :dialog
  798. ' toolbar&                            :dialog
  799. ' menu&                               :menu
  800. ' window_menu&                        :menu
  801. ' fvt_popu&                           :dialog
  802. ' fvt_lsbx&                           :dialog
  803. ' fvt_prog&                           :dialog
  804. ' fvt_asci&                           :dialog
  805. ' fvt_altr&                           :dialog
  806. ' iconify_icon_1&                     :dialog
  807. ' backgrnd&                           :dialog
  808. ' fvt_alst&                           :dialog
  809. ' fvt_alic&                           :dialog
  810. ' fvt_work&                           :dialog
  811. ' fvt_maus&                           :dialog
  812. ' fvt_strt&                           :dialog
  813. ' ---------------------------------------------------------------------------
  814. ' OBJECT NAMES:
  815. ' button1&                            :object in tree buttons&
  816. ' button2&                            :object in tree buttons&
  817. ' close_buttons&                      :object in tree buttons&
  818. ' ob_check3&                          :object in tree checks&
  819. ' ob_check4&                          :object in tree checks&
  820. ' ob_check5&                          :object in tree checks&
  821. ' ob_check6&                          :object in tree checks&
  822. ' ob_check1&                          :object in tree checks&
  823. ' ob_check2&                          :object in tree checks&
  824. ' check_close&                        :object in tree checks&
  825. ' radio1&                             :object in tree radios&
  826. ' radio2&                             :object in tree radios&
  827. ' a_radio1&                           :object in tree radios&
  828. ' a_radio2&                           :object in tree radios&
  829. ' a_radio3&                           :object in tree radios&
  830. ' radios_close&                       :object in tree radios&
  831. ' t_pen&                              :object in tree radios&
  832. ' t_spray&                            :object in tree radios&
  833. ' t_line&                             :object in tree radios&
  834. ' t_shape&                            :object in tree radios&
  835. ' t_bezier&                           :object in tree radios&
  836. ' t_circle&                           :object in tree radios&
  837. ' nscroll&                            :object in tree input&
  838. ' slider&                             :object in tree input&
  839. ' nscroll_edit&                       :object in tree input&
  840. ' numeric&                            :object in tree input&
  841. ' text_only&                          :object in tree input&
  842. ' callback&                           :object in tree input&
  843. ' show_callback&                      :object in tree input&
  844. ' input_close&                        :object in tree input&
  845. ' img_rpop&                           :object in tree popups&
  846. ' img_mpop&                           :object in tree popups&
  847. ' txt_rpop&                           :object in tree popups&
  848. ' txt_mpop&                           :object in tree popups&
  849. ' popup_close&                        :object in tree popups&
  850. ' sa_disppop&                         :object in tree popups&
  851. ' radio_lstbox&                       :object in tree listbxes&
  852. ' checl_lstbox&                       :object in tree listbxes&
  853. ' menu_lstbox&                        :object in tree listbxes&
  854. ' open_listbox1&                      :object in tree listbxes&
  855. ' open_lstbox2&                       :object in tree listbxes&
  856. ' open_lstbox3&                       :object in tree listbxes&
  857. ' lstbox_close&                       :object in tree listbxes&
  858. ' mstate1&                            :object in tree mstate&
  859. ' mstate4&                            :object in tree mstate&
  860. ' mstate2&                            :object in tree mstate&
  861. ' mstate3&                            :object in tree mstate&
  862. ' mstate_close&                       :object in tree mstate&
  863. ' misc_drag&                          :object in tree other&
  864. ' misc_move&                          :object in tree other&
  865. ' misc_close&                         :object in tree other&
  866. ' resize_close&                       :object in tree resize_me&
  867. ' foldable_close&                     :object in tree foldable&
  868. ' sa_freqpop&                         :object in tree toolstrip&
  869. ' sa_zoompop&                         :object in tree toolstrip&
  870. ' toolstrip_open&                     :object in tree toolstrip&
  871. ' sa_play_dma&                        :object in tree toolstrip&
  872. ' toolstrip_save&                     :object in tree toolstrip&
  873. ' toolbar_radios&                     :object in tree toolbar&
  874. ' toolbar_sel&                        :object in tree toolbar&
  875. ' about&                              :object in tree menu&
  876. ' demo_quit&                          :object in tree menu&
  877. ' prg_modal&                          :object in tree menu&
  878. ' non_modal&                          :object in tree menu&
  879. ' toolbox_modal&                      :object in tree menu&
  880. ' m_buttons&                          :object in tree menu&
  881. ' m_status&                           :object in tree menu&
  882. ' m_radios&                           :object in tree menu&
  883. ' m_input&                            :object in tree menu&
  884. ' m_popups&                           :object in tree menu&
  885. ' m_listboxes&                        :object in tree menu&
  886. ' m_multistate&                       :object in tree menu&
  887. ' m_resize&                           :object in tree menu&
  888. ' m_foldable&                         :object in tree menu&
  889. ' m_other&                            :object in tree menu&
  890. ' menu_ascii&                         :object in tree menu&
  891. ' menu_alerts&                        :object in tree menu&
  892. ' menu_progress&                      :object in tree menu&
  893. ' menu_busy&                          :object in tree menu&
  894. ' demo_simple_win&                    :object in tree menu&
  895. ' demo_hor_tlstrip&                   :object in tree menu&
  896. ' demo_ver_toolbar&                   :object in tree menu&
  897. ' demo_menu_window&                   :object in tree menu&
  898. ' iconify_all&                        :object in tree menu&
  899. ' uniconify_all&                      :object in tree menu&
  900. ' menu_help&                          :object in tree menu&
  901. ' menu_gen_help&                      :object in tree menu&
  902. ' test&                               :object in tree window_menu&
  903. ' font_selector&                      :object in tree window_menu&
  904. ' sinus&                              :object in tree fvt_popu&
  905. ' sawtooth&                           :object in tree fvt_popu&
  906. ' square&                             :object in tree fvt_popu&
  907. ' alert_1&                            :object in tree fvt_alst&
  908. ' alert_3&                            :object in tree fvt_alst&
  909. ' fv_copyright&                       :object in tree fvt_alst&
  910. ' globemaus&                          :object in tree fvt_maus&
  911. ' macbusymouse&                       :object in tree fvt_maus&
  912. '
  913. ' ---------------------------------------------------------------------------
  914. ' YOUR VARIABLES: (see PROCEDURE user_rsc_var_init for details)
  915. '
  916. ' ob_check3_var!                      :animated switch in tree checks&
  917. ' ob_check4_var!                      :animated switch in tree checks&
  918. ' ob_check5_var!                      :animated switch in tree checks&
  919. ' ob_check6_var!                      :animated switch in tree checks&
  920. ' ob_check1_var!                      :selectable in tree checks&
  921. ' ob_check2_var!                      :selectable in tree checks&
  922. ' radio1_var&                         :radio button set in tree radios&
  923. ' a_radio1_var&                       :animated radiobutton set in tree radios&
  924. ' t_pen_trpvar&                       :Toolbox radio popup set in tree radios&
  925. ' t_pen_var&                          :Toolbox radio popup in tree radios&
  926. ' t_spray_var&                        :Toolbox radio popup in tree radios&
  927. ' t_line_var&                         :Toolbox radio popup in tree radios&
  928. ' t_shape_var&                        :Toolbox radio popup in tree radios&
  929. ' t_bezier_var&                       :Toolbox radio popup in tree radios&
  930. ' t_circle_var&                       :Toolbox radio popup in tree radios&
  931. ' nscroll_var&                        :numberscroller in tree input&
  932. ' nscroll_edit_var&                   :numberscroller in tree input&
  933. ' numeric_var$                        :editable text in tree input&
  934. ' text_only_var$                      :editable text in tree input&
  935. ' callback_var$                       :editable text in tree input&
  936. ' show_callback_var$                  :f(box)text (not editable) in tree input&
  937. ' img_rpop_var&                       :radio popup in tree popups&
  938. ' txt_rpop_var&                       :radio popup in tree popups&
  939. ' sa_disppop_var&                     :radio popup in tree popups&
  940. ' radio_lstbox_arr$                   :listbox text array in tree listbxes&
  941. ' radio_lstbox_ndx&                   :listbox num entries in tree listbxes&
  942. ' radio_lstbox_var&                   :listbox radio in tree listbxes&
  943. ' checl_lstbox_arr$                   :listbox text array in tree listbxes&
  944. ' checl_lstbox_ndx&                   :listbox num entries in tree listbxes&
  945. ' checl_lstbox_arr!                   :checklistbox flag array in tree listbxes&
  946. ' menu_lstbox_arr$                    :listbox text array in tree listbxes&
  947. ' menu_lstbox_ndx&                    :listbox num entries in tree listbxes&
  948. ' open_listbox1_arr$                  :open listbox text array in tree listbxes&
  949. ' open_listbox1_ndx&                  :open listbox num entries in tree listbxes&
  950. ' open_listbox1_scrl&                  :open listbox scroll value in tree listbxes&
  951. ' open_lstbox2_arr$                   :open listbox text array in tree listbxes&
  952. ' open_lstbox2_ndx&                   :open listbox num entries in tree listbxes&
  953. ' open_lstbox2_var&                   :open listbox radio in tree listbxes&
  954. ' open_lstbox2_scrl&                   :open listbox scroll value in tree listbxes&
  955. ' open_lstbox3_arr$                   :open listbox text array in tree listbxes&
  956. ' open_lstbox3_arr!                   :open listbox flag array in tree listbxes&
  957. ' open_lstbox3_ndx&                   :open listbox num entries in tree listbxes&
  958. ' open_lstbox3_scrl&                   :open listbox scroll value in tree listbxes&
  959. ' mstate1_var&                        :multistate button in tree mstate&
  960. ' mstate4_var&                        :multistate button in tree mstate&
  961. ' mstate2_var&                        :multistate button in tree mstate&
  962. ' mstate3_var&                        :multistate button in tree mstate&
  963. ' sa_freqpop_var&                     :radio popup in tree toolstrip&
  964. ' sa_zoompop_var&                     :radio popup in tree toolstrip&
  965. ' toolbar_radios_var&                 :radio button set in tree toolbar&
  966. ' prg_modal_var&                      :menuRadioItem set in tree menu&
  967. '
  968. ' ---------------------------------------------------------------------------
  969. ' WINDOW TYPES:
  970. ' toolstrip_window%
  971. ' toolbar_window%
  972. ' menu_in_window%
  973. ' simple_window%
  974. '
  975. '
  976. ' ---------------------------------------------------------------------------
  977. '
  978. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  979. ' viewer_userhandle_&       : userhandle of the fileviewer-window       !ΩΩFVW:fileviewerΩΩ
  980. ' viewer_windowhandle_&     : internal (fileviewer-wrinkle)             !ΩΩFVW:fileviewerΩΩ
  981. ' viewer_$()                : internal (fileviewer-wrinkle)             !ΩΩFVW:fileviewerΩΩ
  982. ' viewer_selected_!()       : internal (fileviewer-wrinkle)             !ΩΩFVW:fileviewerΩΩ
  983. ' viewer_maxlines_%         : internal (fileviewer-wrinkle)             !ΩΩFVW:fileviewerΩΩ
  984. ' viewer_entries_%          : internal (fileviewer-wrinkle)             !ΩΩFVW:fileviewerΩΩ
  985. ' viewer_dragdrop_!         : internal (fileviewer-wrinkle)             !ΩΩFVW:fileviewerΩΩ
  986. ' messagewin_userhandle_&       : userhandle of the messagewin-window   !ΩΩFVW:messagewinΩΩ
  987. ' messagewin_windowhandle_&     : internal (messagewin-wrinkle)         !ΩΩFVW:messagewinΩΩ
  988. ' messagewin_$()                : internal (messagewin-wrinkle)         !ΩΩFVW:messagewinΩΩ
  989. ' messagewin_selected_!()       : internal (messagewin-wrinkle)         !ΩΩFVW:messagewinΩΩ
  990. ' messagewin_maxline_%          : internal (messagewin-wrinkle)         !ΩΩFVW:messagewinΩΩ
  991. ' messagewin_entries_%          : internal (messagewin-wrinkle)         !ΩΩFVW:messagewinΩΩ
  992. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  993. '
  994. RETURN
  995. > FUNCTION user_rsc_bubble_help$(tree&,object&)
  996. LOCAL help_str$
  997. help_str$=""
  998. '
  999. ' To enter a bubble help text for an object, simply write
  1000. ' help_str$="My help text"like this into its CASE entry
  1001. ' (directly below it). If you do not want bubble help for
  1002. ' a given object, just delete its CASE entry...
  1003. '
  1004. ' Example:
  1005. ' SELECT tree&
  1006. ' CASE my_dialog&
  1007. '   SELECT object&
  1008. '   CASE my_object&
  1009. '     help_str$="Here is my example help text...!"
  1010. '   ENDSELECT
  1011. ' ENDSELECT
  1012. '
  1013. SELECT tree&
  1014. CASE tear_off&
  1015. SELECT object&
  1016. ENDSELECT
  1017. '
  1018. ' ----------------------------------------------------------------------------
  1019. CASE t_pens&
  1020. SELECT object&
  1021. ENDSELECT
  1022. '
  1023. ' ----------------------------------------------------------------------------
  1024. CASE t_sprays&
  1025. SELECT object&
  1026. ENDSELECT
  1027. '
  1028. ' ----------------------------------------------------------------------------
  1029. CASE t_lines&
  1030. SELECT object&
  1031. ENDSELECT
  1032. '
  1033. ' ----------------------------------------------------------------------------
  1034. CASE t_shapes&
  1035. SELECT object&
  1036. ENDSELECT
  1037. '
  1038. ' ----------------------------------------------------------------------------
  1039. CASE t_beziers&
  1040. SELECT object&
  1041. ENDSELECT
  1042. '
  1043. ' ----------------------------------------------------------------------------
  1044. CASE t_rshapes&
  1045. SELECT object&
  1046. ENDSELECT
  1047. '
  1048. ' ----------------------------------------------------------------------------
  1049. CASE buttons&
  1050. SELECT object&
  1051. CASE button1&
  1052. help_str$=""
  1053. CASE button2&
  1054. help_str$=""
  1055. CASE close_buttons&
  1056. help_str$=""
  1057. ENDSELECT
  1058. '
  1059. ' ----------------------------------------------------------------------------
  1060. CASE checks&
  1061. SELECT object&
  1062. CASE ob_check3&
  1063. help_str$=""
  1064. CASE ob_check4&
  1065. help_str$=""
  1066. CASE ob_check5&
  1067. help_str$=""
  1068. CASE ob_check6&
  1069. help_str$=""
  1070. CASE ob_check1&
  1071. help_str$=""
  1072. CASE ob_check2&
  1073. help_str$=""
  1074. CASE check_close&
  1075. help_str$=""
  1076. ENDSELECT
  1077. '
  1078. ' ----------------------------------------------------------------------------
  1079. CASE radios&
  1080. SELECT object&
  1081. CASE radio1&
  1082. help_str$=""
  1083. CASE radio2&
  1084. help_str$=""
  1085. CASE a_radio1&
  1086. help_str$=""
  1087. CASE a_radio2&
  1088. help_str$=""
  1089. CASE a_radio3&
  1090. help_str$=""
  1091. CASE radios_close&
  1092. help_str$=""
  1093. CASE t_pen&
  1094. help_str$=""
  1095. CASE t_spray&
  1096. help_str$=""
  1097. CASE t_line&
  1098. help_str$=""
  1099. CASE t_shape&
  1100. help_str$=""
  1101. CASE t_bezier&
  1102. help_str$=""
  1103. CASE t_circle&
  1104. help_str$=""
  1105. ENDSELECT
  1106. '
  1107. ' ----------------------------------------------------------------------------
  1108. CASE input&
  1109. SELECT object&
  1110. CASE nscroll&
  1111. help_str$=""
  1112. CASE slider&
  1113. help_str$=""
  1114. CASE nscroll_edit&
  1115. help_str$=""
  1116. CASE numeric&
  1117. help_str$=""
  1118. CASE text_only&
  1119. help_str$=""
  1120. CASE callback&
  1121. help_str$=""
  1122. CASE show_callback&
  1123. help_str$=""
  1124. CASE input_close&
  1125. help_str$=""
  1126. ENDSELECT
  1127. '
  1128. ' ----------------------------------------------------------------------------
  1129. CASE popups&
  1130. SELECT object&
  1131. CASE img_rpop&
  1132. help_str$=""
  1133. CASE img_mpop&
  1134. help_str$=""
  1135. CASE txt_rpop&
  1136. help_str$=""
  1137. CASE txt_mpop&
  1138. help_str$=""
  1139. CASE popup_close&
  1140. help_str$=""
  1141. CASE sa_disppop&
  1142. help_str$=""
  1143. ENDSELECT
  1144. '
  1145. ' ----------------------------------------------------------------------------
  1146. CASE listbxes&
  1147. SELECT object&
  1148. CASE radio_lstbox&
  1149. help_str$=""
  1150. CASE checl_lstbox&
  1151. help_str$=""
  1152. CASE menu_lstbox&
  1153. help_str$=""
  1154. CASE open_listbox1&
  1155. help_str$=""
  1156. CASE open_lstbox2&
  1157. help_str$=""
  1158. CASE open_lstbox3&
  1159. help_str$=""
  1160. CASE lstbox_close&
  1161. help_str$=""
  1162. ENDSELECT
  1163. '
  1164. ' ----------------------------------------------------------------------------
  1165. CASE mstate&
  1166. SELECT object&
  1167. CASE mstate1&
  1168. help_str$=""
  1169. CASE mstate4&
  1170. help_str$=""
  1171. CASE mstate2&
  1172. help_str$=""
  1173. CASE mstate3&
  1174. help_str$=""
  1175. CASE mstate_close&
  1176. help_str$=""
  1177. ENDSELECT
  1178. '
  1179. ' ----------------------------------------------------------------------------
  1180. CASE other&
  1181. SELECT object&
  1182. CASE misc_drag&
  1183. help_str$=""
  1184. CASE misc_move&
  1185. help_str$=""
  1186. CASE misc_close&
  1187. help_str$=""
  1188. ENDSELECT
  1189. '
  1190. ' ----------------------------------------------------------------------------
  1191. CASE resize_me&
  1192. SELECT object&
  1193. CASE resize_close&
  1194. help_str$=""
  1195. ENDSELECT
  1196. '
  1197. ' ----------------------------------------------------------------------------
  1198. CASE foldable&
  1199. SELECT object&
  1200. CASE foldable_close&
  1201. help_str$=""
  1202. ENDSELECT
  1203. '
  1204. ' ----------------------------------------------------------------------------
  1205. CASE toolstrip&
  1206. SELECT object&
  1207. CASE sa_freqpop&
  1208. help_str$=""
  1209. CASE sa_zoompop&
  1210. help_str$=""
  1211. CASE toolstrip_open&
  1212. help_str$=""
  1213. CASE sa_play_dma&
  1214. help_str$=""
  1215. CASE toolstrip_save&
  1216. help_str$=""
  1217. ENDSELECT
  1218. '
  1219. ' ----------------------------------------------------------------------------
  1220. CASE toolbar&
  1221. SELECT object&
  1222. CASE toolbar_radios&
  1223. help_str$=""
  1224. CASE toolbar_sel&
  1225. help_str$=""
  1226. ENDSELECT
  1227. '
  1228. ' ----------------------------------------------------------------------------
  1229. CASE menu&
  1230. SELECT object&
  1231. CASE about&
  1232. help_str$=""
  1233. CASE demo_quit&
  1234. help_str$=""
  1235. CASE prg_modal&
  1236. help_str$=""
  1237. CASE non_modal&
  1238. help_str$=""
  1239. CASE toolbox_modal&
  1240. help_str$=""
  1241. CASE m_buttons&
  1242. help_str$=""
  1243. CASE m_status&
  1244. help_str$=""
  1245. CASE m_radios&
  1246. help_str$=""
  1247. CASE m_input&
  1248. help_str$=""
  1249. CASE m_popups&
  1250. help_str$=""
  1251. CASE m_listboxes&
  1252. help_str$=""
  1253. CASE m_multistate&
  1254. help_str$=""
  1255. CASE m_resize&
  1256. help_str$=""
  1257. CASE m_foldable&
  1258. help_str$=""
  1259. CASE m_other&
  1260. help_str$=""
  1261. CASE menu_ascii&
  1262. help_str$=""
  1263. CASE menu_alerts&
  1264. help_str$=""
  1265. CASE menu_progress&
  1266. help_str$=""
  1267. CASE menu_busy&
  1268. help_str$=""
  1269. CASE demo_simple_win&
  1270. help_str$=""
  1271. CASE demo_hor_tlstrip&
  1272. help_str$=""
  1273. CASE demo_ver_toolbar&
  1274. help_str$=""
  1275. CASE demo_menu_window&
  1276. help_str$=""
  1277. CASE iconify_all&
  1278. help_str$=""
  1279. CASE uniconify_all&
  1280. help_str$=""
  1281. CASE menu_help&
  1282. help_str$=""
  1283. CASE menu_gen_help&
  1284. help_str$=""
  1285. ENDSELECT
  1286. '
  1287. ' ----------------------------------------------------------------------------
  1288. CASE window_menu&
  1289. SELECT object&
  1290. CASE test&
  1291. help_str$=""
  1292. CASE font_selector&
  1293. help_str$=""
  1294. ENDSELECT
  1295. '
  1296. ' ----------------------------------------------------------------------------
  1297. CASE fvt_lsbx&
  1298. SELECT object&
  1299. ENDSELECT
  1300. '
  1301. ' ----------------------------------------------------------------------------
  1302. CASE fvt_prog&
  1303. SELECT object&
  1304. ENDSELECT
  1305. '
  1306. ' ----------------------------------------------------------------------------
  1307. CASE fvt_asci&
  1308. SELECT object&
  1309. ENDSELECT
  1310. '
  1311. ' ----------------------------------------------------------------------------
  1312. CASE fvt_altr&
  1313. SELECT object&
  1314. ENDSELECT
  1315. '
  1316. ' ----------------------------------------------------------------------------
  1317. CASE iconify_icon_1&
  1318. SELECT object&
  1319. ENDSELECT
  1320. '
  1321. ' ----------------------------------------------------------------------------
  1322. CASE fvt_work&
  1323. SELECT object&
  1324. ENDSELECT
  1325. '
  1326. ' ----------------------------------------------------------------------------
  1327. CASE fvt_strt&
  1328. SELECT object&
  1329. ENDSELECT
  1330. '
  1331. ' ----------------------------------------------------------------------------
  1332. ENDSELECT
  1333. '
  1334. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1335. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1336. '
  1337. ' ----------------------------------------------------------------------------
  1338. IF help_str$=""
  1339. help_str$="There is no help available for this object" !***if no bubble help
  1340. ENDIF
  1341. RETURN help_str$
  1342. ENDFUNC
  1343. > PROCEDURE user_rsc_draw_extra(userhandle&,index&,tree&,tree%,cx&,cy&,cw&,ch&)
  1344. LOCAL x&,y&,w&,h&
  1345. ~GRAF_MOUSE(256,0) !hidem - to avoid "mousedroppings"
  1346. '
  1347. ' This procedure is here if you need to draw anything in the dialog that
  1348. ' cannot be in the RSC-file. The clipping rectangle is already set
  1349. ' for this procedure (walking the rectangle tree) MUST NOT BE ALTERED!!!
  1350. ' Else you may find yourself drawing over other objects, or even windows!
  1351. '
  1352. ' <userhandle&> is the userhandle you gave when opening the window
  1353. '               or -1 if it is a dialog window
  1354. ' <index&> is the index of this window in window_array&(index&,x)
  1355. ' <tree&> is the object tree number of the dialog or toolstrip/bar
  1356. ' <tree%> is the object tree adress of the dialog or toolstrip/bar
  1357. ' <cx&>,<cy&>,<cw&>,<ch&> is the clipping rectangle set
  1358. '
  1359. ' You should limit your drawing/blitting commands to the size and
  1360. ' location of an IBOX/BOX object. The BOX will give you a backround,
  1361. ' the IBOX will not. The location and width/height of the IBOX/BOX
  1362. ' are found by calling:
  1363. '
  1364. ' @rsc_ob_xywh(tree%,object&,x&,y&,w&,h&)
  1365. '
  1366. ' <tree%> is the object tree adress
  1367. ' <object&> is the object number
  1368. ' <x&> is the x-coordinate
  1369. ' <y&> is the y-coordinate
  1370. ' <w&> is the width
  1371. ' <h&> is the height
  1372. '
  1373. ' So you might set up a SELECT/CASE structure that looks
  1374. ' something like this example:
  1375. '
  1376. '   SELECT tree&
  1377. '   CASE dialog_1&
  1378. '     @rsc_ob_xywh(tree%,help2&,x&,y&,w&,h&)
  1379. '     DEFFILL 1,2,5
  1380. '     PBOX x&,y&,PRED(ADD(x&,w&)),PRED(ADD(y&,h&))
  1381. '   CASE toolstrip_h&
  1382. '     @rsc_ob_xywh(tree%,t_clip&,x&,y&,w&,h&)
  1383. '     DEFFILL 1,2,5
  1384. '     PBOX x&,y&,PRED(ADD(x&,w&)),PRED(ADD(y&,h&))
  1385. '   ENDSELECT
  1386. '
  1387. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1388. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1389. '
  1390. ~GRAF_MOUSE(257,0) !showm - display pointer again
  1391. RETURN
  1392. > PROCEDURE user_on_exit
  1393. '
  1394. ' This procedure is called when you exit the program. If you need to
  1395. ' release memory, restore the original desktop or do other
  1396. ' "cleaning up" tasks, do it here.
  1397. '
  1398. ' If run as an accessory, this procedure is called EVERY TIME
  1399. ' THE ACCESSORY IS CLOSED. (Remember: An accessory is NEVER exited)
  1400. '
  1401. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1402. @viewer_close                           !ΩΩFVW:fileviewerΩΩ
  1403. @messagewin_close                                                       !ΩΩFVW:messagewinΩΩ
  1404. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1405. '
  1406. RETURN
  1407. > FUNCTION user_quit_ok
  1408. $F%
  1409. exit_program!=FALSE
  1410. IF acc!
  1411. RETURN TRUE
  1412. ELSE
  1413. '
  1414. ' User wants to quit
  1415. ' Return value: TRUE  to quit
  1416. '               FALSE to ignore
  1417. '
  1418. ' The following SELECT-CASE-ENDSELECT structure is just an example.
  1419. ' If you want to use an alert,  you may (should?:-) want to use
  1420. ' a windowed alert...
  1421. '
  1422. ' The rest of the code in this function should *NOT* be altered!
  1423. '
  1424. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1425. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1426. '
  1427. SELECT FORM_ALERT(1,"[1][Really quit? ][ OK |Cancel]")
  1428. CASE 1
  1429. RETURN TRUE
  1430. CASE 2
  1431. RETURN FALSE
  1432. ENDSELECT
  1433. '
  1434. ENDIF
  1435. ENDFUNC
  1436. > FUNCTION user_systemcheck
  1437. $F%
  1438. '
  1439. ' This function is called immediately when the program is started,
  1440. ' and only if the requirements in the system procedure 'SYSTEMCHECK'
  1441. ' is met. Remember: The RSC is NOT YET LOADED! If you need to check
  1442. ' anything special (like a cookie) before allowing the program to load
  1443. ' and run, do it here.
  1444. '
  1445. ' To continue, return TRUE
  1446. ' To abort the program, return FALSE
  1447. '
  1448. ' If you abort the program, use an alert to tell the user WHY the program
  1449. ' is aborted.
  1450. '
  1451. ' If you have no need to check anything, just leave this function empty,
  1452. ' except of course for the 'RETURN TRUE' line below.
  1453. '
  1454. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1455. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1456. '
  1457. RETURN TRUE
  1458. ENDFUNC
  1459. > PROCEDURE user_gem_messages(mx&,my&,ks&,m0&,m1&,m2&,m3&,m4&,m5&,m6&,m7&)
  1460. '
  1461. ' Any message the Face Value engine do not understand, goes to this proc.
  1462. ' Here, you are free to implement your own communication protocols, or
  1463. ' to ignore unknown messages completly and leave it empty.
  1464. '
  1465. ' <mx&> and <my&> are the mouse coordinates at the time of the message
  1466. ' <ks&> is the keyboard state at the time of the message
  1467. ' <m0&> to <m7&> are the actual words in the message
  1468. '
  1469. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1470. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1471. '
  1472. RETURN
  1473. > PROCEDURE user_mouse(handle&,userhandle&,index&,mx&,my&,mc&,mb&,ks&)
  1474. LOCAL x&,y&,w&,h&
  1475. '
  1476. ' If the user clicks in the work area of a userwindow
  1477. ' with the mouse, this procedure is called. The mouse-coordinates
  1478. ' are screen coordinates. There is no reason to check if the mouse is
  1479. ' inside the work area of the window, this procedure would not be called
  1480. ' otherwise.
  1481. '
  1482. ' To get the true work area of this window, you call:
  1483. '
  1484. @win_get_workarea(index&,x&,y&,w&,h&)
  1485. '
  1486. ' <x&>,<y&>,<w&> and <h&> are x,y,width and height for the work area
  1487. ' of the window.
  1488. '
  1489. ' <handle&> is the GEM handle of the window
  1490. ' <userhandle&> is the userhandle you gave when opening the window
  1491. ' <index&> is the index of this window in window_array&(index&,x)
  1492. ' <mx&> is the x-mouseposition
  1493. ' <my&> is the y-mouseposition
  1494. ' <mc&> is the number of clicks (1=normal/2=double clicked)
  1495. ' <mb&> is the mousebutton that was clicked (1=left/2=right)
  1496. ' <ks&> is the keyboard state when the mouse was clicked, thus:
  1497. '     IF AND(ks&,&X11): shift key pressed (either one)
  1498. '     IF BTST(ks&,2)  : control key pressed
  1499. '     IF BTST(ks&,3)  : alternate key pressed
  1500. '
  1501. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1502. ' ---------------------------------------------------------------------------   !ΩΩFVW:textlistΩΩ
  1503. ' Textlist-Wrinkle:     (©1997 by Holger Herzog)                                !ΩΩFVW:textlistΩΩ
  1504. '                                                                               !ΩΩFVW:textlistΩΩ
  1505. ' Call textlist_click to handle mouseclicks in textlist-userwindows.            !ΩΩFVW:textlistΩΩ
  1506. '                                                                               !ΩΩFVW:textlistΩΩ
  1507. ' LOCAL dd!                                                                     !ΩΩFVW:textlistΩΩ
  1508. ' SELECT userhandle&                                                            !ΩΩFVW:textlistΩΩ
  1509. ' CASE xxx                                                                      !ΩΩFVW:textlistΩΩ
  1510. '  LET dd!=TRUE        ! allow drag&drop                                        !ΩΩFVW:textlistΩΩ
  1511. '  LET selected&=@textlist_click(index&,mx&,my&,mb&,ks&,mc&,dd!,num%,selected!(),hash&())       !ΩΩFVW:textlistΩΩ
  1512. '  IF selected&=>0                                                              !ΩΩFVW:textlistΩΩ
  1513. '    ' Doubleclick!                                                             !ΩΩFVW:textlistΩΩ
  1514. '  ENDIF                                                                        !ΩΩFVW:textlistΩΩ
  1515. ' ENDSELECT                                                                     !ΩΩFVW:textlistΩΩ
  1516. '                                                                               !ΩΩFVW:textlistΩΩ
  1517. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1518. '
  1519. RETURN
  1520. > FUNCTION user_dragdrop_init(handle&,userhandle&,index&,x&,y&,ks&,VAR datatypes$)
  1521. $F%
  1522. '
  1523. ' A drag & drop protocol is initiated. Your program is the recipient.
  1524. ' The variables have the following meaning:
  1525. '
  1526. ' <handle&> is the GEM handle of the targeted window
  1527. ' <userhandle&> is the userhandle you gave when opening the window if
  1528. '               this is a userwindow. If it is not, <userhandle&> will
  1529. '               be -1
  1530. ' <index&> is the index of this window in window_array&(index&,x)
  1531. ' <x&> is the x-mouseposition when the object was dropped on your window
  1532. ' <y&> is the y-mouseposition when the object was dropped on your window
  1533. ' <ks&> is the keyboard state  when the object was dropped on your window:
  1534. '     IF AND(ks&,&X11): shift key pressed (either one)
  1535. '     IF BTST(ks&,2)  : control key pressed
  1536. '     IF BTST(ks&,3)  : alternate key pressed
  1537. '
  1538. ' <datatypes$> is a variable that is sent back to the routine performing
  1539. '              the drag & drop. It should be filled with 4-byte extenders
  1540. '              of the filetypes you can recieve for this window. An
  1541. '              example: ".IMG.TXT.ASC" Note that the extenders should
  1542. '              be preceeded by a "." There must NOT be more than 8
  1543. '              extenders (32 bytes) There are two special extendertypes:
  1544. '
  1545. '              "ARGS" - Standard commandline. Note there is no preceeding "."
  1546. '                       Used by the desktop when files are dragged to an
  1547. '                       application's window. Could be more than 1 filename.
  1548. '
  1549. '              "PATH" - The window has a path connected to it (a document
  1550. '                       window), and can SEND this to the other application.
  1551. '                       No preceeding "." here, either.
  1552. '
  1553. ' IMPORTANT: <datatypes$> should NOT exceed 32 bytes in lenght. It should
  1554. '            NOT be left empty, unless you want to cancel the drag & drop
  1555. '            session.
  1556. '
  1557. ' To continue the drag & drop protocol, return 0. To cancel, return 1.
  1558. ' IMPORTANT: THIS IS THE ONLY RETURN VALUES ALLOWED!!!
  1559. '
  1560. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1561. IF userhandle&=viewer_userhandle_&                      !ΩΩFVW:fileviewerΩΩ
  1562. IF viewer_dragdrop_!                                    !ΩΩFVW:fileviewerΩΩ
  1563. LET datatypes$=".TXT.ASCARGS"                         !ΩΩFVW:fileviewerΩΩ
  1564. RETURN 0                                              !ΩΩFVW:fileviewerΩΩ
  1565. ELSE                                                    !ΩΩFVW:fileviewerΩΩ
  1566. RETURN 1                                              !ΩΩFVW:fileviewerΩΩ
  1567. ENDIF                                                   !ΩΩFVW:fileviewerΩΩ
  1568. ENDIF                                                   !ΩΩFVW:fileviewerΩΩ
  1569. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1570. '
  1571. RETURN 1
  1572. '
  1573. ENDFUNC
  1574. > FUNCTION user_dragdrop_path(handle&,userhandle&,index&,x&,y&,ks&,size%,VAR path$)
  1575. $F%
  1576. '
  1577. ' This function is called when another application requests the path
  1578. ' to the window in <handle&>
  1579. '
  1580. ' The variables have the following meaning:
  1581. '
  1582. ' <handle&> is the GEM handle of the targeted window
  1583. ' <userhandle&> is the userhandle you gave when opening the window if
  1584. '               this is a userwindow. If it is not, <userhandle&> will
  1585. '               be -1
  1586. ' <index&> is the index of this window in window_array&(index&,x)
  1587. ' <x&> is the x-mouseposition when the object was dropped on your window
  1588. ' <y&> is the y-mouseposition when the object was dropped on your window
  1589. ' <ks&> is the keyboard state  when the object was dropped on your window:
  1590. '     IF AND(ks&,&X11): shift key pressed (either one)
  1591. '     IF BTST(ks&,2)  : control key pressed
  1592. '     IF BTST(ks&,3)  : alternate key pressed
  1593. '
  1594. ' <size%> is the maximum lenght of the path that can be returned
  1595. '
  1596. ' <path$> is a variable that is sent back to the routine performing
  1597. '         the drag & drop. It should be filled the path connected
  1598. '         to the window.
  1599. '
  1600. ' IMPORTANT: <path$> should NOT exceed <size%> bytes in lenght. It should
  1601. '            NOT be left empty, unless you cancel the drag & drop session
  1602. '            and return 1
  1603. '
  1604. ' To return the path to the application that requested it, return 0.
  1605. ' To cancel, return 1.
  1606. '
  1607. ' IMPORTANT: THIS IS THE ONLY RETURN VALUES ALLOWED!!!
  1608. '
  1609. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1610. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1611. '
  1612. RETURN 1
  1613. '
  1614. ENDFUNC
  1615. > FUNCTION user_dragdrop_accept(handle&,userhandle&,index&,x&,y&,ks&,type$,id$,file$,size%)
  1616. $F%
  1617. '
  1618. ' An application wants to send data to your application.
  1619. '
  1620. ' The variables have the following meaning:
  1621. '
  1622. ' <handle&> is the GEM handle of the targeted window
  1623. ' <userhandle&> is the userhandle you gave when opening the window if
  1624. '               this is a userwindow. If it is not, <userhandle&> will
  1625. '               be -1
  1626. ' <index&> is the index of this window in window_array&(index&,x)
  1627. ' <x&> is the x-mouseposition when the object was dropped on your window
  1628. ' <y&> is the y-mouseposition when the object was dropped on your window
  1629. ' <ks&> is the keyboard state  when the object was dropped on your window:
  1630. '     IF AND(ks&,&X11): shift key pressed (either one)
  1631. '     IF BTST(ks&,2)  : control key pressed
  1632. '     IF BTST(ks&,3)  : alternate key pressed
  1633. '
  1634. ' <type$> is the type of data (4 bytes long, ex: ".IMG", ".TXT" etc).
  1635. ' <id$> is the datas name (not its filename)
  1636. ' <file$> is the filename the data is associated to (if any)
  1637. ' <size%> is the length in bytes of the data the sending application has
  1638. '         dropped on your window.
  1639. '
  1640. '
  1641. ' RETURN VALUES:
  1642. '   0 = Accept. the procedure @user_dragdrop_loaddata() will be called
  1643. '       and the data can be loaded there.
  1644. '   1 = Abort
  1645. '   2 = Unacceptable format of the data. Try again.
  1646. '   3 = Too much data. Try again.
  1647. '   4 = Data has been dropped on a trashcan and the sending application should
  1648. '       delete this data.
  1649. '   5 = Data has been dropped on a printer and the sending application should
  1650. '       print this data.
  1651. '   6 = Data has been dropped on a clipboard and the sending application should
  1652. '       copy the data to the clipboard this data.
  1653. '
  1654. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1655. IF userhandle&=viewer_userhandle_&                              !ΩΩFVW:fileviewerΩΩ
  1656. IF viewer_dragdrop_!                                            !ΩΩFVW:fileviewerΩΩ
  1657. SELECT type$                                                  !ΩΩFVW:fileviewerΩΩ
  1658. CASE ".TXT",".ASC","ARGS"                                     !ΩΩFVW:fileviewerΩΩ
  1659. RETURN 0                                                    !ΩΩFVW:fileviewerΩΩ
  1660. DEFAULT                                                       !ΩΩFVW:fileviewerΩΩ
  1661. RETURN 2                                                    !ΩΩFVW:fileviewerΩΩ
  1662. ENDSELECT                                                     !ΩΩFVW:fileviewerΩΩ
  1663. ELSE                                                            !ΩΩFVW:fileviewerΩΩ
  1664. RETURN 1                                                      !ΩΩFVW:fileviewerΩΩ
  1665. ENDIF                                                           !ΩΩFVW:fileviewerΩΩ
  1666. ENDIF                                                           !ΩΩFVW:fileviewerΩΩ
  1667. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1668. '
  1669. RETURN 1
  1670. '
  1671. ENDFUNC
  1672. > PROCEDURE user_dragdrop_loaddata(handle&,userhandle&,index&,x&,y&,ks&,type$,id$,file$,size%,f_handle&)
  1673. '
  1674. ' Now you can load the data from the drag & drop session.
  1675. '
  1676. ' The variables have the following meaning:
  1677. '
  1678. ' <handle&> is the GEM handle of the targeted window
  1679. ' <userhandle&> is the userhandle you gave when opening the window if
  1680. '               this is a userwindow. If it is not, <userhandle&> will
  1681. '               be -1
  1682. ' <index&> is the index of this window in window_array&(index&,x)
  1683. ' <x&> is the x-mouseposition when the object was dropped on your window
  1684. ' <y&> is the y-mouseposition when the object was dropped on your window
  1685. ' <ks&> is the keyboard state  when the object was dropped on your window:
  1686. '     IF AND(ks&,&X11): shift key pressed (either one)
  1687. '     IF BTST(ks&,2)  : control key pressed
  1688. '     IF BTST(ks&,3)  : alternate key pressed
  1689. '
  1690. ' <type$> is the type of data (4 bytes long, ex: ".IMG", ".TXT" etc).
  1691. ' <id$> is the datas name (not its filename)
  1692. ' <file$> is the filename the data is associated to (if any)
  1693. ' <size%> is the length in bytes of the data the sending application has
  1694. '         dropped on your window.
  1695. ' <f_handle&> is the FILEhandle that should be used to read the data. The
  1696. '             file is already open, and will be closed when you exit this
  1697. '             procedure. To read, you *MUST* use:
  1698. '
  1699. ' return%=@fread(f_handle&,adr%,size%)
  1700. '
  1701. ' <adr%> is the adress to load the data into.
  1702. ' If <return%> is negative, an error occured.
  1703. '
  1704. ' ΩΩwsnippetΩΩ  - Wrinkle code: (don't change or delete this flag)
  1705. ' ΩΩwsnippetΩΩ  - End of Wrinkle code: (don't change or delete this flag)
  1706. '
  1707. RETURN
  1708.